<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="/WEB-INF/template/template.xhtml">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<ui:define name="body">
	

		<h:form acceptcharset="ISO-8859-1" id="formCadastroCategoria">
			<div class="body_center_100">
				<rich:panel style="height: 500px;">
				<h:messages for="formCadastroCategoria" infoClass="info" warnClass="warn" errorClass="error"/>
					<f:facet name="header">
        			CATEGORIAS
        			<h:commandButton value="Buscar" action="#{categoriaMB.buscar}"></h:commandButton>
        			<h:commandButton value="Salvar" action="#{categoriaMB.salvar}"></h:commandButton>
        			<h:commandButton value="Limpar" action="#{categoriaMB.limpar}"></h:commandButton>
					</f:facet>

					<h:panelGrid columns="2">
						<h:outputLabel value="Descricao:" />
						<h:inputText value="#{categoriaMB.buscarCategoria.descricao}"></h:inputText>
						
						<h:outputLabel value="URL rss:" />
						<h:inputText value="#{categoriaMB.buscarCategoria.urlRss}"></h:inputText>
						
						<h:outputLabel value="Ativo:" />
						<h:selectBooleanCheckbox value="#{categoriaMB.buscarCategoria.status}">
						</h:selectBooleanCheckbox>
					</h:panelGrid>

					<rich:dataTable value="#{categoriaMB.categorias}" var="categoria">
						<h:column>
							<f:facet name="header">Descricao</f:facet>
							<h:outputText value="#{categoria.descricao}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">URL rss</f:facet>
							<h:outputText value="#{categoria.urlRss}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">Editar</f:facet>
							<h:commandLink action="#{categoriaMB.editar(categoria)}">
								<h:graphicImage  library="edit.png" url="/resources/images/edit.png"></h:graphicImage>
							</h:commandLink>
						</h:column>
					</rich:dataTable>

				</rich:panel>
			</div>
		</h:form>
	</ui:define>
</ui:composition>